<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
    "http://struts.apache.org/dtds/struts-2.1.dtd">

<struts>

	<package name="cms_base" extends="base" >
		<interceptors>
			<interceptor name="systemManager" class="com.ogilvy.cms.interceptions.AdminInterceptor"></interceptor>
			<interceptor name="privlegeInter" class="com.ogilvy.cms.interceptions.PrivlegeInterceptor"></interceptor>
			<interceptor-stack name="systemManagerStack">
				<interceptor-ref name="systemManager"></interceptor-ref>
			    <interceptor-ref name="defaultStack"></interceptor-ref>
				<interceptor-ref name="privlegeInter"></interceptor-ref>
			</interceptor-stack>
			<interceptor-stack name="managerStack">
				<interceptor-ref name="systemManager"></interceptor-ref>
				<interceptor-ref name="defaultStack"></interceptor-ref>
			</interceptor-stack>
			
		</interceptors>
  		
		<global-results>
			<result name="error" >/error/error.jsp</result>
			<result name="adminLogin" type="redirect">/admin/login.jsp</result>
			<result name="privlegeEroor" type="redirect">/admin/privlege_eroor.jsp</result>
			<result name="notFindEroor" type="redirect">/admin/error/404.jsp</result>
			<result name="serverEroor" type="redirect">/admin/error/500.jsp</result>
			<result name="execl" type="stream">
        		<param name="contentType">   
                    application/vnd.ms-excel   
                </param>   
                <param name="inputName">excelStream</param>   
                <param name="contentDisposition">   
                    filename="export.xls"  
                </param>
        	</result>
		</global-results>
		<global-exception-mappings>
			<exception-mapping result="privlegeEroor" exception="com.ogilvy.frame.exception.PrivlegeException"></exception-mapping>
			<exception-mapping result="notFindEroor" exception="com.ogilvy.frame.exception.NotFindException"></exception-mapping>
			<exception-mapping result="error" exception="Exception"></exception-mapping>
		</global-exception-mappings>
		
	</package>
    
    <package name="login" extends="struts-default" namespace="/admin">
    	<action name="login" class="cms.action.CmsUserAction" method="login">
        	<result name="login">/admin/login.jsp</result>
        	<result type="redirect" name="index">
        		/admin/index.jsp
        	</result>
        </action>
        <action name="islogin" class="cms.action.CmsUserAction" method="islogin" />
        
        <action name="pageComment_*" class="cms.action.CmsPageCommentAction" method="{1}" />
    </package>
    <package name="lefttree" extends="cms_base" namespace="/admin">
    	<default-interceptor-ref name="managerStack"></default-interceptor-ref>
    	<!-- 菜单树 -->
        <action name="lefttree" class="cms.action.CmsLeftTreeAction" />
    </package>
    <package name="system" extends="cms_base" namespace="/admin">
	   <default-interceptor-ref name="managerStack"></default-interceptor-ref>
	   
	    <!-- 用户action -->
        <action name="user_*" class="cms.action.CmsUserAction" method="{1}">
        	<result name="index">/admin/system/user/user_list.jsp</result>
        	<result name="detail">/admin/system/user/user_detail.jsp</result>
        </action>
        <!-- 数据字典action -->
        <action name="dictionary_*" class="cms.action.CmsDictionaryAction" method="{1}">
        	<result name="dictionary">/admin/system/dictionary/dictionary_list.jsp</result>
        </action>
        <!-- 系统日志action -->
        <action name="log_*" class="cms.action.CmsLogAction" method="{1}">
        	<result name="log">/admin/system/log/log_list.jsp</result>
        </action>
        
        <!-- 页面审核记录action -->
        <action name="pageaudit_*" class="cms.action.CmsPageAuditAction" method="{1}">
        	<result name="pageaudit">/admin/system/pageaudit/pageaudit_list.jsp</result>
        </action>
        
        <!-- 页面版本action -->
        <action name="pageversions_*" class="cms.action.CmsPageVersionsAction" method="{1}">
        	<result name="pageversions">/admin/system/pageversions/pageversions_list.jsp</result>
        </action>
        
        
        <!-- 模版组件action -->
        <action name="component_*" class="cms.action.CmsComponentAction" method="{1}">
            <result name="index">/admin/system/component/component_list.jsp</result>
        </action>
        
        <!-- 模版定义action -->
        <action name="template_*" class="cms.action.CmsTemplateAction" method="{1}">
            <result name="index">/admin/system/template/template_list.jsp</result>
        </action>
        
         
        <!-- 模版字段定义action -->
        <action name="templatefield_*" class="cms.action.CmsTemplateFieldAction" method="{1}">
            <result name="index">/admin/system/templatefield/templatefield_list.jsp</result>
        </action>
        
        <!-- 网页action -->
        <action name="page_*" class="cms.action.CmsPageAction" method="{1}">
        	<result name="page">/admin/system/page/page_list.jsp</result>
        </action>
        
        <!-- 资源文件action -->
        <action name="resource_*" class="cms.action.CmsResourceAction" method="{1}">
        	<result name="resource">/admin/system/resource/resource_list.jsp</result>
        </action>
        
        <!-- 角色action -->
        <action name="role_*" class="cms.action.CmsRoleAction" method="{1}">
        	<result name="index">/admin/system/role/role_list.jsp</result>
        </action>
        <!-- crp_ -->
        <!-- 角色权限action -->
        <action name="crp_*" class="cms.action.CmsRolePriviAction" method="{1}">
        	<result name="index">/admin/system/privileges/privileges_list.jsp</result>
        </action>
	  </package>
	
</struts>
